home *** CD-ROM | disk | FTP | other *** search
/ PC World 2006 November / PCWorld_2006-11_cd.bin / domacnost a kancelar / easytime / ETT.exe / reports / xslt / DetailedTimesheetGroupByMonth.xsl < prev    next >
Extensible Markup Language  |  2006-08-18  |  3KB  |  91 lines

  1. <?xml version="1.0"?>
  2. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  3.     <xsl:output method="html" indent="yes"/>
  4.     <xsl:template match="/">
  5.         <html>
  6.             <head>
  7.                     <link rel="stylesheet" type="text/css" href="style.css"></link>
  8.             </head>
  9.             <xsl:apply-templates select="/Report/HeaderInfo"></xsl:apply-templates>
  10.             <xsl:apply-templates select="/Report/Date"></xsl:apply-templates>
  11.             <xsl:apply-templates select="/Report/Total"/>
  12.         </html>
  13.     </xsl:template>
  14.  
  15.     <!-- ╨Æ╨╡╤Ç╤à╨╜╨╕╨╣ ╨╖╨░╨│╨╛╨╗╨╛╨▓╨╛╨║  -->
  16.     <xsl:template match="HeaderInfo">
  17.         <table class="TableSB" align="center" width="90%">
  18.             <tr>
  19.                 <td>
  20.                     <table class="TableSB" width="100%" cellpadding="2" cellspacing="0" >
  21.                         <tr>
  22.                             <td colspan="2" align="center" class="ReportTitleClass"><xsl:value-of select="/Report/@Type"/></td>
  23.                         </tr>
  24.                         <xsl:if test="Date">  <!--╨ò╤ü╨╗╨╕ ╤Å╨▓╨╜╨╛ ╨▓╤ï╨▒╤Ç╨░╨╜ ╨┤╨╕╨░╨┐╨░╨╖╨╛╨╜ ╨┤╨░╤é  -->
  25.                             <tr>
  26.                                 <td colspan="2" align="right" class="Date"><xsl:value-of select="Date/From"/> - <xsl:value-of select="Date/To"/></td>
  27.                             </tr>
  28.                         </xsl:if>
  29.                     </table>
  30.                 </td>
  31.             </tr>
  32.         </table>
  33.     </xsl:template>
  34.  
  35.     <xsl:template match="Date">
  36.         <table align="center" width="90%">
  37.         <tr>
  38.             <td class="FromTo" colspan="6"><xsl:value-of select="@From"/> - <xsl:value-of select="@To"/></td>
  39.         </tr>
  40.         <xsl:if test="position()=1">
  41.             <td class="DetailRowTitleClass">Date</td>
  42.             <td class="DetailRowTitleClass">Company</td>
  43.             <td class="DetailRowTitleClass">Project</td>
  44.             <td class="DetailRowTitleClass">Task</td>
  45.             <td class="DetailRowTitleClass">Description</td>
  46.             <td class="DetailRowTitleClass">Hours</td>
  47.         </xsl:if>
  48.         <xsl:apply-templates select="Day"/>
  49.         <tr>
  50.             <td colspan="5" width="60%" valign="top" class="SubTotal">Sub-total:</td>
  51.             <td width="40%" valign="top" class="DetailRowDataClass1"><xsl:value-of select="SubTotal"/></td>
  52.         </tr>
  53.     </table>
  54.     </xsl:template>
  55.  
  56.     <xsl:template match="Day">
  57.         <tr>
  58.             <td width="10%" valign="top" class="DetailRowDataClass"><xsl:value-of select="@Value"/></td>
  59.             <td width="20%" valign="top" class="DetailRowDataClass"><xsl:value-of select="Company"/></td>
  60.             <td width="20%" valign="top" class="DetailRowDataClass"><xsl:value-of select="Project"/></td>
  61.             <td width="20%" valign="top" class="DetailRowDataClass"><xsl:value-of select="Task"/></td>
  62.             <td width="30%" valign="top" class="DetailRowDataClass"><xsl:value-of select="Description"/></td>
  63.             <td width="10%" valign="top" class="DetailRowDataClass1"><xsl:value-of select="Hours"/></td>
  64.         </tr>
  65.     </xsl:template>
  66.  
  67.     <xsl:template match="Companies/Company">
  68.         <xsl:value-of select="text()"/>
  69.         <xsl:if test="following-sibling::*/text()">, </xsl:if>
  70.     </xsl:template>
  71.  
  72.     <xsl:template match="Projects/Project">
  73.         <xsl:value-of select="text()"/>
  74.         <xsl:if test="following-sibling::*/text()">, </xsl:if>
  75.     </xsl:template>
  76.  
  77.     <xsl:template match="Tasks/Task">
  78.         <xsl:value-of select="text()"/>
  79.         <xsl:if test="following-sibling::*/text()">, </xsl:if>
  80.     </xsl:template>
  81.  
  82.      <xsl:template match="/Report/Total">
  83.      <table align="center" width="90%">
  84.         <tr>
  85.             <td width="90%" class="Total">Total:</td>
  86.             <td class="Total"><xsl:value-of select="text()" /></td>
  87.        </tr>
  88.     </table>
  89.     </xsl:template>
  90.  
  91. </xsl:stylesheet>